using System;
using Mysoft.Dbf.Writers;

namespace Mysoft.Dbf
{
    public class ExportByContentArrayAttribute : ExportToDBFAttributeBase
    {
        byte _startFrom;
        byte _end;
        string _variableName;
        Type _containedType;
        public ExportByContentArrayAttribute(byte startFrom, byte end, string variableName, Type containnedType)
        {
            _startFrom = startFrom;
            _end = end;
            _variableName = variableName;
            _containedType = containnedType;
        }

        public override IWriter GetWriter()
        {
            return new ArrayWriter(_variableName, _startFrom, _end, new ContentWriter(_containedType));
        }

    }
}
